Fix Docker API version incompatibility by removing forced default version#11336
Closed
taole33 wants to merge 1 commit intotestcontainers:mainfrom
Closed
Fix Docker API version incompatibility by removing forced default version#11336taole33 wants to merge 1 commit intotestcontainers:mainfrom
taole33 wants to merge 1 commit intotestcontainers:mainfrom
Conversation
|
Would be great to also port this to 1.x afterwards. |
Author
I'd be happy to open a backport PR for the 1.x series after this is merged. |
|
I'm not a maintainer, looks like there will be no more 1.x releases. |
Author
|
The PR failed in CI. I ran the full CI-test suite in my repository excluding DockerMcpGatewayContainerTest and it passed, so the cause is definitely DockerMcpGatewayContainerTest. I am investigating why it failed. |
Member
|
Thanks for your contribution. We have decided to add a fallback version, the one that was used before v1.32. See #11346 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Fixes #11232
In #11216, a default fallback to VERSION_1_44 was introduced in DockerClientProviderStrategy. However, this change broke compatibility for users running older Docker versions (e.g., Docker v24 supports up to API 1.43) because the client forces a newer API version than the server supports.
Since docker-java supports auto-negotiation when the version is null (UNKNOWN), strictly pinning it to 1.44 is unnecessary and causes regressions for legacy environments.
Changes
Removed the block that forces VERSION_1_44 when the API version is unknown.
This restores the behavior of relying on docker-java's auto-negotiation (or safe defaults).
Verification
I have verified this fix locally on the following environments:
Docker v29.1.2 (API 1.52, Min 1.44): Passed. (Auto-negotiated correctly)
Docker v24.0 (dind, API 1.43): Passed. (Auto-negotiated correctly)